**************************************************
*                                                * 
* Could rebel child soldiers prolong civil wars? *
*                                                * 
* Roos Haer and Tobias Boehmelt                  *
*                                                * 
* Replication Instructions                       *
*                                                * 
* This Version: June 23, 2016                    *
*                                                * 
**************************************************

*******************************
* Kaplan-Meier Survival Curve *
*******************************

preserve

replace _t=_t-16436
replace _t0=_t0-16436
sts graph if csdummy!=., by(csdummy) ci level(90) 
sts test csdummy, logrank

restore

**************************
* Descriptive Statistics *
**************************

sum term _t csdummy csindex tc scc mcap arcp fcap lpw strong parity terr coups ef ethnic lngdppc demdum act2 lnpop if csdummy!=. 

***********************************************
* Main Models - Aggregated Strength Variables *
***********************************************

stcox csdummy tc strong parity lpw terr coups ef ethnic lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid)
stphtest, rank
drop schoen* scaled*

stcox csindex tc strong parity lpw terr coups ef ethnic lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid)
stphtest, rank
drop schoen* scaled*

stcox csdummy tc strong parity lpw ef lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid) strata(terr coups ethnic)
stphtest, rank
drop schoen* scaled*

stcox csindex tc strong parity lpw ef lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid) strata(terr coups ethnic)
stphtest, rank
drop schoen* scaled*

**************************************************
* Main Models - Disaggregated Strength Variables *
**************************************************

stcox csdummy tc scc mcap arcp fcap lpw terr coups ef ethnic lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid)
stphtest, rank
drop schoen* scaled*

stcox csindex tc scc mcap arcp fcap lpw terr coups ef ethnic lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid)
stphtest, rank 
drop schoen* scaled*

stcox csdummy tc scc mcap arcp fcap lpw ef lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid) strata(terr coups ethnic)
stphtest, rank
drop schoen* scaled*

stcox csindex tc scc mcap arcp fcap lpw ef lngdppc demdum act2 lnpop, schoenfeld(schoen*) scaledsch(scaled*) efron nohr cluster(confid) strata(terr coups ethnic)
stphtest, rank 
drop schoen* scaled*

*******************
* Survival Curves *
*******************

stcox csdummy tc scc mcap arcp fcap lpw terr coups ef ethnic lngdppc demdum act2 lnpop, efron nohr cluster(confid)
stcurve, survival at1(csdummy=0) at2(csdummy=1) name(graph1, replace)

stcox csindex tc scc mcap arcp fcap lpw terr coups ef ethnic lngdppc demdum act2 lnpop, efron nohr cluster(confid)
stcurve, survival at1(csindex=0) at2(csindex=1) at3(csindex=2) name(graph2, replace)

graph combine graph1 graph2, ycommon

*******************
* 3SLS Regression *
*******************

reg3 (_d csdummy tc strong parity terr coups demdum _t) (csdummy _d _t lpw lnpop lngdppc ef ethnic act2), endo(_t)

*******************************
* Governments' Child Soldiers *
*******************************

stcox csdummy CSGovUse tc strong parity lpw terr coups ef ethnic lngdppc demdum act2 lnpop, efron nohr cluster(confid)
stcox csdummy CSGovUse tc scc mcap arcp fcap lpw terr coups ef ethnic lngdppc demdum act2 lnpop, efron nohr cluster(confid)
